﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace MotoGame.Estados.Jogo
{
    class Jogo:EstadoBase
    {
        Moto moto1;
        Moto moto2;

        public Jogo(ContentManager Content, GameWindow Window)
            :base(Content)
        {
            moto1 = new Moto(Content, Window, "moto");
            moto2 = new Moto(Content, Window, "moto2");
        }

        public override void Update(GameTime gameTime)
        {
            moto1.Update(gameTime, Game1.teclado_atual );
            moto2.Update(gameTime, Game1.teclado_atual );

          if(moto1.colisao.X >= moto2.colisao.X)
          {
              moto2.visivel = false;
          }

        }

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            moto1.Draw(gameTime, spriteBatch);
            moto2.Draw(gameTime, spriteBatch);
       


        }

    }
}
